import React from 'react'
import './GoodsItem.css'
export default function GoodsItem({
  goods_count,
  goods_img,
  goods_name,
  goods_price,
  goods_state,
  id,
  changeHandle,
}) {
  return (
    <div className="my-goods-item">
      <div className="left">
        <div className="custom-control custom-checkbox">
          <input
            type="checkbox"
            className="custom-control-input"
            id={id}
            checked={goods_state}
            onChange={() => {
              // console.log(goods_state, 999)
              changeHandle(id, !goods_state)
            }}
          />
          <label className="custom-control-label" htmlFor={id}>
            <img
              src="https://fuss10.elemecdn.com/e/5d/4a731a90594a4af544c0c25941171jpeg.jpeg"
              alt=""
            />
          </label>
        </div>
      </div>
      <div className="right">
        <div className="top">{goods_name}</div>
        <div className="bottom">
          <span className="price">
            ¥ {goods_price}/共{goods_count}件
          </span>
          <span>counter组件</span>
        </div>
      </div>
    </div>
  )
}
